export function timeAgo(timestamp) {
	const now = new Date().getTime();
	const diff = (now - timestamp) / 1000; // 转换为秒

	if (diff < 60) {
		return '1分钟内';
	} else if (diff < 3600) { // 1小时内的逻辑
		const minutes = Math.floor(diff / 60);
		return `${minutes}分钟`;
	} else if (diff < 86400) { // 1天内的逻辑
		const hours = Math.floor(diff / 3600);
		return `${hours}小时`;
	} else if (diff < 2592000) { // 1月内的逻辑（大约30天）
		const days = Math.floor(diff / 86400);
		return `${days}天`;
	} else if (diff < 7776000) { // 3月内的逻辑（大约90天）
		const months = Math.floor(diff / 2592000);
		return `${months}月`;
	} else {
		return '6个月';
	}
}